/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.hadoop.hdfs.util;

import org.apache.hadoop.util.InjectionEventI;

/** 
 * Enumeration of all injection events for hdfs.
 * When defining new events, please PREFIX the name 
 * with the supervised class.
 * 
 * Please see InjectionHandler.
 * 
 * Please implement InjectionEventI for non-hdfs code (e.g., core)
 */
public enum InjectionEvent implements InjectionEventI {
  
  JOURNALANDSTREAM_STARTLOGSEGMENT,

  BKJM_STARTLOGSEGMENT,
  BKJM_VALIDATELOGSEGMENT,

  FSIMAGE_STARTING_SAVE_NAMESPACE,
  FSIMAGE_CREATING_SAVER_THREADS,
  FSIMAGE_STARTING_SAVER_THREAD,
  FSIMAGE_SN_CLEANUP,
  FSIMAGE_CANCEL_REQUEST_RECEIVED,
  FSIMAGE_SAVED_IMAGE,
  FSIMAGE_UPGRADE_BEFORE_SAVE_IMAGE,
  FSIMAGE_UPGRADE_AFTER_SAVE_IMAGE,
  FSIMAGE_ROLLBACK_DONE,
  
  FSEDIT_LOG_WRITE_END_LOG_SEGMENT,
  FSEDIT_AFTER_AUTOMATIC_ROLL,
  
  FSNAMESYSTEM_CLOSE_DIRECTORY,
  FSNAMESYSTEM_STOP_LEASEMANAGER,
  FSNAMESYSTEM_ADDSTORED_BLOCK,
  FSNAMESYSTEM_VERSION_REQUEST,
  FSNAMESYSTEM_STOP_MONITOR,
  FSNAMESYSTEM_INITIALBR_WORKER,
  FSNAMESYSTEM_BLOCKREPORT_COMPLETED,
  FSNAMESYSTEM_SKIP_LOCAL_DN_LOOKUP,

  
  LEASEMANAGER_CHECKLEASES,
  LEASEMANAGER_CHECKINTERRUPTION,

  STANDBY_CANCELLED_EXCEPTION_THROWN,
  STANDBY_FELL_BEHIND,
  STANDBY_INSTANTIATE_INGEST, 
  STANDBY_QUIESCE_INGEST, 
  STANDBY_ENTER_CHECKPOINT, 
  STANDBY_EXIT_CHECKPOINT,
  STANDBY_EXIT_CHECKPOINT_EXCEPTION,
  STANDBY_EXIT_CHECKPOINT_FAILED_ROLL,
  STANDBY_BEFORE_SAVE_NAMESPACE, 
  STANDBY_BEFORE_PUT_IMAGE,
  STANDBY_BEFORE_ROLL_EDIT, 
  STANDBY_BEFORE_ROLL_IMAGE, 
  STANDBY_BEGIN_RUN, 
  STANDBY_EDITS_NOT_EXISTS,
  STANDBY_CREATE_INGEST_RUNLOOP,
  STANDBY_AFTER_DO_CHECKPOINT,
  STANDBY_CHECKPOINT_TRIGGER,
  STANDBY_VALIDATE_CREATE,
  STANDBY_VALIDATE_CREATE_FAIL,
  STANDBY_UPLOAD_CREATE,
  STANDBY_UPLOAD_FAIL,
  STANDBY_QUIESCE_INITIATED,
  STANDBY_QUIESCE_INTERRUPT,
  STANDBY_QUIESCE_INGEST_CKPT,
  STANDBY_RECOVER_STATE,
  STANDBY_JOURNAL_GETSTREAM,
  STANDBY_FAILOVER_INPROGRESS,
  STANDBY_SAFEMODE_CHECKMODE,
  STANDBY_DELAY_CHECKPOINT,

  INGEST_BEFORE_LOAD_EDIT,
  INGEST_READ_OP,
  INGEST_CLEAR_STANDBY_STATE,
  INGEST_TXID_CHECK,
  
  OFFERSERVICE_SCHEDULE_HEARTBEAT,
  OFFERSERVICE_SCHEDULE_BR,
  OFFERSERVICE_CLEAR_PRIMARY,
  OFFERSERVICE_START,
  OFFERSERVICE_BEFORE_REGISTRATION,
  OFFERSERVICE_BEFORE_CLEARPRIMARY,
  OFFERSERVICE_DNAFINALIZE,
  OFFERSERVICE_PREPARE_FAILOVER,
  OFFERSERVICE_BEFORE_INIT_PROXY2,
  
  AVATARNODE_CHECKEDITSTREAMS,
  AVATARNODE_SHUTDOWN,
  AVATARNODE_SHUTDOWN_COMPLETE,
  AVATARNODE_WAIT_FOR_RESTART,
  AVATARNODE_BLOCKRECEIVED_AND_DELETED_NEW,
  AVATARNODE_RECEIVED_DATA_TRANSFER_VERSION,

  AVATARDATANODE_BEFORE_START_OFFERSERVICE1,
  AVATARDATANODE_BEFORE_START_OFFERSERVICE2,
  AVATARDATANODE_START_OFFERSERVICE1,
  AVATARDATANODE_START_OFFERSERVICE2,

  TRANSFERFSIMAGE_GETFILESERVER0, 
  TRANSFERFSIMAGE_GETFILESERVER1, 
  TRANSFERFSIMAGE_GETFILESERVER2,
  TRANSFERFSIMAGE_GETFILESERVER3,

  SECONDARYNAMENODE_CHECKPOINT0, 
  SECONDARYNAMENODE_CHECKPOINT1,
  
  AVATARXEIVER_RUNTIME_FAILURE,
  DATAXEIVER_SERVER_PRE_ACCEPT,

  NAMENODE_AFTER_CREATE_FILE,
  NAMENODE_STOP_RPC,
  NAMENODE_VERIFY_CHECKPOINTER,
  NAMENODE_GET_BLOCKS_TOTAL,
  NAMENODE_FSCK_START,
  NAMENODE_RECONFIG_HFTP,
  
  FAILOVERCLIENTPROTOCOL_AFTER_CREATE_FILE,

  AVATARZK_GET_REGISTRATION_TIME,
  CACHINGAVATARZK_GET_PRIMARY_ADDRESS,

  DAFS_CHECK_FAILOVER,
  
  IMAGE_LOADER_CURRENT_START,
  IMAGE_LOADER_CURRENT_INTERRUPT,
  
  SAVE_NAMESPACE_CONTEXT_EXCEPTION,

  STANDBY_ENTER_SAFE_MODE,
  
  BLOCKPLACEMENTPOLICYRAID_CACHED_PATH,
  BLOCKPLACEMENTPOLICYRAID_CACHED_BLOCKS,
  
  RAID_ENCODING_SKIP_PATH,
  RAID_ENCODING_SKIP_PATH_TOO_NEW_MOD,
  RAID_ENCODING_PARTIAL_STRIPE_ENCODED,
  RAID_ENCODING_FAILURE_PARTIAL_PARITY_SIZE_MISMATCH,
  RAID_ENCODING_FAILURE_BLOCK_MISSING,
  RAID_ENCODING_FAILURE_PUT_CHECKSUM,
  RAID_ENCODING_FAILURE_RENAME_FILE,
  RAID_ENCODING_FAILURE_CONCAT_FILE,
  RAID_ENCODING_FAILURE_GET_SRC_STRIPES,
  RAID_ENCODING_FAILURE_PUT_STRIPE,
  RAID_HTTPSERVER_TIMEOUT,
  RAID_SEND_RECOVERY_TIME,

  DFSCLIENT_START_FETCH_FROM_DATANODE,
  
  SERVERLOGREADER_UPDATE,
  SERVERLOGREADER_READOP,
  DFSCLIENT_READBUFFER_BEFORE,
  DFSCLIENT_READBUFFER_AFTER,
  DFSCLIENT_DATASTREAM_AFTER_WAIT,

  DFSCLIENT_GET_LOCATED_BLOCKS,
  DFSCLIENT_DATASTREAM_BEFORE_WRITE,
  
  DFSCLIENT_BEFORE_ADD_DEADNODES,
  DFSCLIENT_BEFORE_BEST_NODE,
  DFSCLIENT_BLOCK_RENEWAL_DONE,
  DFSCLIENT_BLOCK_RENEWAL_EXCEPTION,
  DFSCLIENT_FINGERPRINT_MISMATCH,

  READ_BLOCK_HEAD_BEFORE_WRITE,
  
  BLOCK_READ_LOCAL_GET_PATH_INFO,
  
  DATANODE_APPEND_BLOCK,
  DATANODE_WRITE_BLOCK,
  DATANODE_READ_BLOCK,
  DATANODE_SKIP_NATIVE_OPERATION,
  DATANODE_PROCESS_RAID_TASK,
  
  DATANODE_BEFORE_RECOVERBLOCK,
  
  DIRECTORY_SCANNER_NOT_STARTED,
  DIRECTORY_SCANNER_BEFORE_FILE_SCAN,
  DIRECTORY_SCANNER_AFTER_FILE_SCAN,
  DIRECTORY_SCANNER_AFTER_DIFF,
  DIRECTORY_SCANNER_FINISHED,

  QJM_JOURNALNODE_JOURNAL,
  QJM_JOURNALNODE_STARTSEGMENT,
  QJM_JOURNALNODE_RECOVERY_COMPLETED,
  
  QJM_URLLOGEDITLOGSTREAM_NEXTOP,

  JOURNAL_STORAGE_FORMAT,

  UPLOADIMAGESERVLET_START,
  UPLOADIMAGESERVLET_RESUME,
  UPLOADIMAGESERVLET_COMPLETE,
}
